<form action="${CONTEXT_PATH}/user/rank/update" method="post" id="users_rank_update" class="form-horizontal">
    <input type="hidden" name="m.uuid" value="${m.uuid}"/>
    <#include "/WEB-INF/template/page/admin/user/rank/_form.ftl"/>
</form>
<script type="text/javascript">
    jQuery("#users_rank_update").ready(function () {
        $(this).find("[name='m.liveflag']").val("${m.liveflag!}");
        $(this).find("[name='m.isdefault']").val("${m.isdefault?string('true','false')}");
        // 定义验证参数
        var validateOptions = $.extend(CONST_VALIDATE.OPTION, {
            rules: {
                "m.rankname": {
                    required: true
                },
                "m.rankstart": {
                    required: true,
                    digits:true,
                    min:0
                },
                "m.rankend": {
                    required: true,
                    digits:true,
                    min:0
                }
            },
            messages: {
                "m.rankname": {
                    required: "<i class='fa fa-exclamation tooltips'></i>等级名称(见习女神,男神,xxx)",
                },
                "m.rankstart": {
                    required: "<i class='fa fa-exclamation tooltips'></i>请输入开始阀值",
                    digits: "<i class='fa fa-exclamation tooltips'></i>请输入大于0的整数",
                    min: $.validator.format("<i class='fa fa-exclamation tooltips'></i>阀值不能小于{0}")
                },
                "m.rankend": {
                    required: "<i class='fa fa-exclamation tooltips'></i>请输入开始阀值",
                    digits: "<i class='fa fa-exclamation tooltips'></i>请输入大于0的整数",
                    min: $.validator.format("<i class='fa fa-exclamation tooltips'></i>阀值不能小于{0}")
                }
            },
            submitHandler:function(form) {
                var modal = $("#ajax_update");
                $(form).ajaxSubmit(function (data, status, xhr) {
                    if (data.status) {
                        toastr.success(data.msg, '操作提示');
                    } else {
                        toastr.error(data.msg, '操作提示');
                    }
                });
                $(modal).modal('hide');
                dtgrid.load();
            }
        });
        //表单验证
        $("#users_rank_update").validate(validateOptions);
    });
</script>